<?php


/* @var $model \app\models\Post */
/* @var $vod_list */
/* @var $this \yii\web\View */

use app\helpers\AppHelper;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\Url;


$default_video_url = $vod_list[0]['name'];

?>

<div class="player-container mb-2">
    <div class="player-thumbnail" style="background: url('<?= AppHelper::formatImage($model['thumbnail']); ?>')fixed top;background-size: cover;">
    </div>

    <div class="columns">
        <div class="column col-7 col-lg-12 col-mx-auto">
            <div class="player" id="player">
                <?php if(!empty($vod_list)): ?>
                <iframe src="<?= $default_video_url; ?>" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>

<div class="container">
    <div class="play-server text-center py-2">
    <?php if(!empty($vod_list)): ?>
        <?php foreach ($vod_list as $i => $item): ?>
        <button href="<?= $item['name']; ?>" class="btn<?= $item['name'] == $default_video_url ? ' active' : ''; ?>">分流<?= AppHelper::getPlayName($i); ?></button>
        <?php endforeach; ?>
    <?php endif; ?>

    </div>
    <?= \app\widgets\PostRelatedWidget::widget(['cid' => $model->cid]); ?>

</div>
